Merck cut its profit guidance due to a charge tied to its acquisition of biotech company Terns Pharmaceuticals.