Make `dist` target depend on `check` to be sure the tarball is good
Check the archive actually generated by the `dist` target
Allow to specify the revision for which `make dist` creates a tarball

Use `make dist REV=1.2.3` to create a tarball for revision `1.2.3`
(for example a tag).  If not specified, the revision is derived from
HEAD using either the tag name pointing there or the short SHA1 for
this revision.