Makefile: Fix build of utest on systems with --as-needed enabled

On systems (such as ALT Linux) where `--as-needed' is passed to ld by
default, building tests fail due to CUNIT_INSTALLED test failure to link
with libcunit, becasue `-lcunit' is passed before input file (which is
`-'). Move `-lcunit' after '-' to link it properly.

To reproduce `make CC='gcc -Wl,--as-needed' test`. Error message:

  Makefile:344: *** CUnit framework not installed, cannot build unit tests.  Stop.

Link: https://lore.kernel.org/linux-trace-devel/20200720164453.5161-2-vt@altlinux.org

Cc: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 file changed