Add script to generate all Makefiles, add -lm switch for Unix linker.