fix makefile variable scope