Start by checking the electrical cabling that goes from the car body to the hatch. It's contained in an electrical "conduit" that starts in the sill (between the two hatch hinges) and goes to the deck lid. You're looking for broken or chafed wiring and exposed copper. The "red flag" symptom for this suggestion/diagnosis is you mentioning the problem occurring with the application of the brakes.
If no problems are found, check the alternator (alt) connector for loose or corroded wires. It's a problematic connector.
Finally, check the smaller diameter wires at the batttery, not just the big thick cables. Look for cracked insulation. Repair as needed. Clean the chassis grounds.
The clickinng noise you hear is simply your start motor relay not receiving enough juice to fully engage the starter motor; it's a classic sign of a dead battery.
Something is either 1) causing your battery not to receive a charge (alt or alt wiring problem) or 2) draining your battery of its existing charge (dead short). I think the cure of "cable wiggling" - providing the battery cables (and all the surrounding smaller wires) are tight and clean - may be coincidental.
Hope that helps. btw, welcome to FF.