The configure script of the swi-prolog jpl package only checks whether lib/$arch/server or jre/lib/$arch/server exists but the $arch subdirectory was removed in openjdk9. Because of the failed check the LDFLAGS are missing the correct directories for libjava.so and related libraries. I have created a pull request to for this: https://github.com/SWI-Prolog/packages-jpl/pull/8
I have tried this on i386 and the package now compiles but make check then fails with the same errors as in #887155. Regards, Benjamin Lorenz