Fixed Makefile to properly build dependencies