ax_have_qt: Autodetect Qt 5 by querying $PATH and qmake

The old logic for detecting Qt did not work for newer versions of Qt,
nor did it work on Debian/Ubuntu with multiarch support. I've replaced
the old hacks and heuristics with clean code that uses a Qt 5 pro file
to detect Qt's parameters from $PATH and qmake. Qt 4 and earlier do not
support this kind of introspection, but any version of Qt can still be
used by explicitly specifying its parameters.