Chancellor Angela Merkel pledged Thursday to do "everything humanly possible" to ensure security in Germany following a string of attacks — including two carried out by asylum-seekers and claimed by the Islamic State group, which she said mocked the country that took in the assailants.