Makefile: configure for libraries properly