build: fix syntax error on older m4/autoconf.

Fixes #3358. This affects preinstalled autotools on osx 10.6.
Use 'make check' instead of 'make test'
Merge pull request #3395 from ldenman/patch-2

Use 'make check' instead of 'make test'
Merge pull request #3393 from theuni/build-10.6

build: fix syntax error on older m4/autoconf.