Making agriculture more resilient to climate change