At least 44 people have been killed in wildfires in Portugal and Spain, according to officials from both countries.