makefile: simplify JavaScript file generation