Chancellor Angela Merkel finally reached a deal Wednesday to form a new German coalition government, handing the powerful finance ministry to the country’s main center-left party in an agreement aimed at ending months of political gridlock.