configure: Add m4 java checks