Add support for external hamcrest when using junit 4.11+

Starting with junit 4.11 hamcrest is no longer bundled,
so add a --with-hamcrest option to support this.

Change-Id: Icdae946af82b9c56bf25d37cbf88275fc6a6a1eb
Reviewed-on: https://gerrit.libreoffice.org/11383
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>