Double taxation on dividend income between USA and Germany. How to avoid/get credit?

My wife is a US citizen and I am a Green Card holder. We are required to file a US tax return for our global income. We are currently living in Germany and are required to file a tax return here as well. The double taxation treaty between the US regulates that Investment income is taxable in the country where you reside, in our case Germany.

I want to ask about the process on how to assure that taxes on dividends I receive on assets I hold in a US brokerage account and that are reported on a 1099-D to the IRS are not double taxed?

The US tax return is due prior to the German tax return. The dividends on the 1099-D are taxed initially in the US. The German tax return (Einkommensteuer) is filed by end of October and per treaty, the dividends received in the US are taxable in Germany and typically a 25% flat rate tax is to be paid to German authorities. 

How and when can I recover this double taxation? Can I avoid paying the taxes in the US in the first place, even though they are reported on the 1099-D? If not, can I claim a tax credit after the German tax report has been issued and the exact amount of German tax is documented. Would I file an amended tax return for that in the US? Which Tax Form is required, Foreign Tax Credit form 1116? 

Your advice is very much welcome. Thanks Michael