Makefile: handle all libs and make more like Magit's