Fixed non-portable shell syntax in tests. Added a dist-hook target to check