Improve handling of scripts in Makefile