That sounds like the starter solenoid. If the known good batteries didn't work, check the connection to starter...the cable under +terminal under hood goes directly to it. Remove nut and look underneath for corrosion. Otherwise, the starter is near the firewall...and those repeat clicks is what I got when my car's battery died on me. Check for tightness, corrosion on all parts of the electric system from battery to starter...ground to body in trunk by the battery...engine ground straps.
Debut Radio Show Tues, May 3, 1 p.m. on Hamiltonradio.net The Mechanical Animals
call in for car repair help! 609-503-4058
A recent set--NSFW audio: https://youtu.be/_dcxcZfD6dg
Mangofy your E46!