Fix library detection of shm* on openSUSE (#8350)

Use the new AC_SERACH_LIBS to check if rt is needed for shm_open
and shm_unlink. This sets LIBS and so the shm_* functions
can be found if librt is indeed required. Passing -lrt through
CFLAGS is not portable.

Signed-off-by: Austin Seipp <austin@well-typed.com>