Interim build fix for Makefiles

Looks like some parts still need detangling. Let's see if this holds for now.