Following talks with Mr Cameron in Berlin, the German Chancellor said that European leaders “shouldn’t be saying that changing the treaties is totally impossible”.
A number of EU countries, including Poland, have suggested that Mr Cameron’s demands to change welfare rules will be blocked.
The Prime Minister wants to stop EU migrants from claiming benefits in the UK for four years and has said treaty change will be necessary to achieve his reforms.
A series of EU leaders have said that treaty change will be blocked by Brussels.
However, Mrs Merkel said: “We have the desire to work very closely together. We would like to be a constructive partner in this process.
“We shouldn’t be saying that changing the treaties is totally impossible.
“Wherever there is a desire there is also a way and this should be our guiding principle.”
She added: “Of course we can accommodate these desires.”
The Prime Minister said: “I was very heartened by what the Chancellor said in terms of where there’s a will there’s a way.”
Her comments will be welcomed by Downing Street and will be seen as a major sign that Germany is willing to meet Mr Cameron’s demands.
Mrs Merkel laid on the red carpet for Mr Cameron in Berlin, the fourth and final stop of his two-day Europe tour to sell his plans for reform of Europe. He was greeted at the Federal Chancellery by a marching band, which played the British and German national anthems, and a large detachment of sailors.
Angela Merkel is listed by Forbes as the most powerful woman in the world
Earlier in the morning, over breakfast at the Palace on the Water in Warsaw, Poland’s Prime Minister told Mr Cameron she would fight his plans to strip EU migrants of in-work benefits such as tax credits.
Mr Cameron believes he can cut soaring migration from Europe by removing the state subsidy for low paid work for foreigners for four years, making life in Britain “less attractive”.
It is the centrepiece of his reform agenda, and it has caused outrage in Poland where politicians are vowing to defend the “rights” of their expatriates, many of whom send their earnings back home.
Ewa Kopacz told Mr Cameron she “strong opposed measures that may lead to discrimination against Poles and other EU citizens seeking legal employment in the UK,” her office said. “She defended one of the fundamental rights on which the EU common market is based.”
Mr Cameron reassured Mrs Kopacz he was “committed to respect the principle of free movement”, a No 10 spokesman said.
“They agreed that there were issues concerning the interaction between free movement and national welfare systems that should be discussed further. ”
The news served at dinner the previous evening with Francois Hollande, the French president, the Elysee Palace had been no more appetising.
A French source at the meeting said Mr Cameron’s welfare plans would be difficult for many EU countries to accept.
A No 10 source acknowledged the difficulty of the meeting, saying there will be “a lot to work through but there was a clear willingness to talk further”.