Donald Trump's warning to drugmakers came shortly after Pfizer entered into a pact that offers it three-year reprieve from tariffs.