Could be a number of things including a loose connection. I would get the dealer to check. Last thing you want is a brake failure.
Definitely need a qualified mechanic to take a look at it.also I have thought to a loose connection, but I don't know whether to check...