Update makefiles and remove unused code