build: link test programs only against static libs