I suppose that the problem is, that your “which qmake” is pointing to completely another qmake binary, not related to Qt, but to Grid Engine: http://gridscheduler.sourceforge.net/htmlman/htmlman1/qmake.html . This is collision of names. To make it working, you should change precedence of the paths in PATH variable: first to point to your Qt qmake binary, then to sge binary.
Given the above, it sounds to me like you want to avoid having /opt/sge/bin/lx-amd64/ in your PATH when you invoke ./configure - assuming you’ve got all the Qt dependencies installed properly. On Ubuntu, the Qt qmake should be in /usr/bin, so I recommend you try:
$ echo $PATH
then copy those parts of the output that aren’t /opt/sge/bin/lx-amd64/, and paste them into:
$ export PATH=<paste here>
and try ./configure again. Realistically, all you should need for ./configure to work on a standard 14.04 install is a very minimal PATH. You only need python, g++ and qmake and the other associated Qt executables (rcc and moc). All of these should be in /usr/bin already. You might find that: