autotools: make the test tool actually work, and other minor fixups

test-tool runs on 'make check' if it's enabled.