fix library dependency order

Autotest from the bug report added.

Task-number: QBS-524

Change-Id: I2ef3485db749424339a2ea96900e49fa5d1363d4
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>