Restructure makefiles

This change makes it easier to add new packages; it's only necessary
to update the sub makefile (lib/Makefile) and add new packaes to the
PACKAGES variable.