Almost all Makefiles support the DESTDIR argument, which let's you install the package into a given directory. So you could do something like:
$ mkdir ./pkg
$ make install DESTDIR=./pkg
The hierarchy of the entire program would then be installed under ./pkg as if it was /. You can then use tar to package all of those files up and then deploy that on the target system. There are also tools like CheckInstall that can do similar things, but I am not sure if they are still actively maintained.