Rename "tests" make rule to "check".

(This is for consistency with Rust.)
Fix test compile errors.
More intelligent "make check" dependencies.