Making external libraries as a dependency, and compiling them in makefile