Hack: fix test and dyntest to correctly use $TESTFLAGS
Merge pull request #2351 from shykes/links-fix-testflags

Hack: fix test and dyntest to correctly use $TESTFLAGS