Adaptation of the microbiome to changing diets