Add ldconfig to Makefile and reorganize