German parties agree on historic debt overhaul to revamp military and economy