Hopefully, you won't have to do a lot of this, because CMake handles most of this automatically.
You can override any variable defined inside a Makefile with command-line arguments to make, e.g.:
$ make CFLAGS='-O2 -G' V=1
A simple step-by-step guide to making a .deb package
A good answer on unix.stackexchange