Angela Merkel admits challenges lie ahead after the right-wing AfD party made gains in the German election that returned her to office for a fourth time.