Updated makefiles and added commandline tool to rebuild