openpty is in libutil.so which is used by jimctl. I saw the error when using gcc 7.2.0 (which is a very old one).
The problem for me was, for reasons unknown, although libutil.so and libutil.a is available inside my /usr/lib64 directory, it cannot be seen/found during the link stage. I believe you are having the same problem
My solution was to add libutil explicitly when running configure, i.e.
LDFLAGS=’-L/usr/lib64 ’ LIBS=’-lutil ’ ./configure