The Mustang appeared before 1944 in the Med and Italy, both the RAF and U.S. versions as well as the A-36 Apache.
The Germans knew it was coming...
I'm sure they did. They were developing there fighters as best they could at the time to meet all the percieived threats and the P-51 must have been one of them.
I don't think they were taken by surprise when the P-51 appeared. They were surprised by some aspects of its performance. I have somewhere (but can't find) a German report which compares the Bf 109K very unfavourably with the P-51.
Threads like this are good fun but we are "solving" the problem without the multitude of constraints which were on the RLM/Luftwaffe at the time.
There is also always a tendency to suggest seemingly simple solutions,like up-arming a particular airframe,which in reality could take months of development to reach a state where they could be put into front line service. For example the MK 103 was a proven weapon but in six months of trying (from July 1944) the Germans never made it work properly in the Do 335.
Steve