German parties agree historic debt overhaul to revamp military and economy