revert replace AM_PATH_SDL2 usage with corresponding PKG_CHECK_MODULES. Reference issue: https://github.com/libsdl-org/SDL/issues/6494 .