Lets say I have files:
Libs:
Program:
All you need to do is tell make that the .o file depends on the .cpp file:
make
%.cpp.o: %.cpp g++ -Wall -c -o $@ $<