Makefile and library structure refactor.