Nations clinch landmark pact to fight climate change