configure.ac: check for org.junit.rules.ExternalResource

Check for org.junit.rules.ExternalResource if build with
--enable-cephfs-java and --with-debug. Checking for junit4
isn't enough since junit4 has this class not before 4.7.

Added some m4 files to get some JAVA related macros. Changed
autogen.sh to work with local m4 files/macros.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>