Well, from what I know, g++ is a compiler, qmake is a makefile. The makefile links all the libraries and other code of the project and then sends to the compiler itself. The compiler will then... compile (transform to binary code). Inside the makefile you should add the compiler options, such as optimizations (-Ox in GCC, where "x" is a number from 1 to 3 or "s"), also archtechture specific parametters (x86, ARM, etc), and other stuff I really don't know.
Are you using some linux distro or Mac? Cygwin is very boring to deal with. If you're on Windows I'd suggest you see Chocolatey, a package manager that can install automatically many tools. On Mac, see Homebrew...