Fix var substitution in makefiles