Mrs Merkel said she wanted friendly relations with both countries as well as Russia but Europe now had to "fight for its own destiny".
It follows the G7's failure to commit to the 2015 Paris climate deal, talks Mrs Merkel said were "very difficult".
President Trump has said he will make a decision in the coming week.
"The times in which we could completely depend on others are on the way out. I've experienced that in the last few days," Mrs Merkel told a crowd at an election rally in Munich, southern Germany.
The BBC's Damien McGuinness, in Berlin, says the comments are a sign of growing assertiveness within the EU.
The relationship between Berlin and new French President Emmanuel Macron had to be a priority, Mrs Merkel said.
Earlier the German leader had described the "six against one" discussion about the Paris Accord during the G7 summit in Sicily as "very difficult, not to say very unsatisfactory".
Mr Trump said he would abandon the Paris deal - the world's first comprehensive climate agreement requiring countries to cut carbon emission - during his election campaign and has also expressed doubts about climate change.
Speaking in Brussels last week, Mr Trump also told Nato members to spend more money on defence and did not re-state his administration's commitment to Nato's mutual security guarantees.
While in Belgium Mr Trump also reportedly described German trade practices as "bad, very bad", complaining that Europe's largest economy sells too many cars to the US.
The US president has described his visit to Europe as a "great success for America" with "big results".
Polls in Germany say Mrs Merkel is on course to be re-elected for a fourth term as German chancellor at elections in September.