Fix library makefile dependency checking