This is actually a very common problem with a lot of mostly American made cars, especially Fords and Saturns. This could mean that you have lost brake pressure or that there is a malfunction with your ABS system. Your brakes act up because your ABS controller is actually disabling the entire system. It's still safe to drive but I would probably take it to the dealership instead of something like Midas.
I wouldn't mess around with it .Take it to Midas ,etc and have them diagnose it very soon
It's most likely a wheel speed sensor check all the wiring going to the wheels and see if anything is unhooked or cut.