"Stereo jacks" may be comprised of four pins, ground left audio right audio and "sense" for lack of any better explanation. IIRC the sense and ground are shorted if headphones are not plugged in and disconnected when they are. This why the speakers blipped out when you plug in the headphones. It's also how you laptop or pc determines when you plug something in.
I'm not an expert but I suggest using two separate amps to do what you want. There is a way to force the amp to drive both external speakers and headphones (nevermind why

) But you'll probably get an impedance mismatch and you'll probably burn something out after awhile.
But if you must. Look for the two pins on the stereo jack that are shorted and not shorted when plugged in. These are the two that need to be soldered together.