Germany's Christian Democrats, Social Democrats and Green Party have struck a deal that will see them vote to amend the country's constitution in order to ramp up defence and infrastructure spending.