build: build qt tests after qt libs/executable

Autotools defaults to a depth-first recursion which causes the qt tests
to be built before the executables and libraries.

This is inconvenient as make needs to be called twice to make sure the
tests are up to date after changing a source file.

Update the Makefile.am to change this order.
Merge pull request #3917

5c80b9a build: build qt tests after qt libs/executable (Wladimir J. van der Laan)