Thousands of deaths across Europe, mostly in France, Spain and Belgium, have been linked to a June heatwave.