fixed up the makefiles and scripts a little