Why don't modern fighter aircraft hide their engine exhaust?
There are a few which do (none of them in production, though) and the reason is the added weight and restrictions in varying nozzle geometry for best efficiency.
The tail arrangement of the F-4 is the result of its heritage. Early McDonnell jets all had the fuselage extended past the engine exhaust in order to shift the engine mass forward, near the wings, so the internal ducting could be as short as possible while the long fuselage held the large amount of fuel required for their initial design as long-range escort fighters. Originally the engines were placed in the wing roots (F2H Banshee) and moved into the fuselage as wings became smaller and thinner while engines grew in size.
Compare the XF-88, the F3H of the Navy, the F-101 Voodoo and the F-110, later to be renamed F-4, and the similarity should be obvious. Other manufacturers like Northrop with their the F-89 Scorpion used the same layout. Like all earlier models, the initial designs of the F4H (the F-4 in the old Navy designation system) used a straight tail. To be fair, at this time IR guided missiles were in their infancy and a low IR signature was not part of the requirements.

XF4H-1 wooden model (picture source)
The later addition of dihedral to the outer wings and anhedral to the tail was for aerodynamic reasons, not to improve IR signature.
NASA's history pages report that

the […] high position of the horizontal tail in combination with the wing-shape parameters led to undesirable nonlinear pitching-moment characteristics at high angles of attack. The large anhedral angle, or droop, of the horizontal-tail surfaces greatly improved the pitching-moment characteristics, as well as increasing directional stability. To achieve the proper balance in dihedral effect for the integrated aircraft configuration, however, a large positive dihedral angle was incorporated in the outer panels of the wing. In addition, the wing dihedral elevated the wingtip vortexes relative to the horizontal tail and further improved the pitching-moment characteristics of the aircraft.

The biggest threat using IR targeting are small, shoulder-launched missiles which target the airplane from below. The F-4 engine and tail arrangement will do nothing to hide its IR signature from them. There are modern fighter designs which hide their IR exhaust, and they place the exhaust on the upper rear fuselage for the reason outlined above.

Top view of the Northrop XF-23 (picture source). However, using a rectangular duct for high-pressure flow requires much more mass than a round duct. Also, optimizing this duct for afterburner operation and thrust vectoring is much harder than with a round duct right at the end of the fuselage.