I am working my way through a make tutorial. Very simple test projects I am trying to build has only 3 files: ./src/main.cpp ./src/implementation.cpp and
CXX = g++ # Just an example
CXXFLAGS = -Wall -O2 # Just an example
prog: main.o implementation.o
$(CXX) $(CXXFLAGS) $^ -o $@
main.o: header.hpp
implementation.o: header.hpp
should do the job. Why your variant isn't working is explained in Konrad Rudolph answer