I recall looking into this a while back. A makefile is more of a script file and you can execute other bash commands before the g++ call.
Every cpp file thrown at the compiler gets outputted as a .o file. Then you collect all the .o files and build them into the executable.
There is most likely a bash command to help determine what .cpp files are new/changed and only rebuild the needed .o files.
I haven't done this, and using a makefile generator just makes it all confusing. But I hope this was a bit insightful. If nobody else has better solutions, I can ask around.