2002 Toyota Sequoia. Won't start. Just hear rapid clicking sound.

Have a 2002 Toyota Sequoia. Speakers were failing due to age, so while I was replacing them, I decided to add an amp to drive the new speakers and add a second amp and a sub. While working on the audio, I unhooked the negative battery terminal and hooked it up again when I needed to go somewhere. As I was driving, my car stalled on me multiple times, though it started up immediately. When I got to my destination, I pulled on the negative battery terminal to see if it was loose. It seemed tight and my car drove normally. When I went back to work on my audio system, I again unhooked my negative battery terminal and again had trouble with my car stalling while driving down the road. Upon completing my audio system hook-up, I started my car and pulled it in the garage for the night and inadvertently left one of the interior lights on overnight. It was still on this morning when I was going to leave for work, but my car would not start. All I am getting is a rapid clicking sound coming from down in the center of the engine back toward the firewall. I tried jump starting it, but had no luck. Any ideas?
Comments
Typicly I would expect this from weak battery or bad cable connection. Stalling might make me look at connection first