Make check-links work under OSX

...and under every other system that doesn't have gnu grep. Also, perl. Yay! :)