Militants attack German base after Merkel visit