Added library file auto detection in Makefile