Over 39,000 hectares burned in Spain as wildfires force thousands to flee