Metal-catalyzed amidation