Spain has evacuated tens of thousands of people from villages west of the capital Madrid where wildfires and extremely dry conditions have been worsened by heatwaves and strong winds.