Yugoslavia 1) allowed its people to freely work in the West, and many people chose to go to West Germany, and 2) Yugoslavia built up extensive tourist infrastructure in Croatia and Montenegro that drew predominantly German-speaking holidaymakers (and not so many English-speaking ones -- UK holidaymakers went for e.g. Spain or Greece during this era). All this made German seem like the language for communicating with foreigners, though among younger generations it is already giving way to English.
Althought I did see enough Lidl and Aldi around.
There is quite a body of scholarship on the sociolinguistics of the Austro-Hungarian Empire, if you are curious.
You don't build a bond with some nation and culture over the course of one century it takes more than that. For example like you probably know Ottoman Empire was ruling and controlling south-east Europe for 500 years and impact of that is very much visible and present today.
Certainly German words in Croatian testify to contacts at some level of the population. Romanian, too, abounds in German words in some domains, for example, but this doesn’t mean the average Romanian would have been able to speak any German. But in Croatia knowledge of German varied greatly from the country’s northwest to its south. Again, the sociolinguistics of the Austro-Hungarian Empire are well-described.
The German connection is definitely there. There was even a transliterated word used for people working abroad: "gastarbajter," from German Gastarbeiter. And it was used for anyone working abroad, no matter where :-)
Edit: https://en.wiktionary.org/w/index.php?title=Category:Serbo-C... . I can't believe "boja" is borrowed.