improved makefile building shared stuff.