lib updates, rewritten makefile