tests: use the CHECK vars from configure instead of manually listing args

Fixes e.g. a missing -l flag.