Fix:
error: implicitly declaring library function 'abort' with type 'void (void) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
error: implicit declaration of function 'getenv' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
error: implicit declaration of function 'ioctl' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
--- configure.orig	2002-03-21 15:52:19.000000000 -0600
+++ configure	2022-08-09 20:21:51.000000000 -0500
@@ -2579,6 +2579,7 @@
 #line 2579 "configure"
 #include "confdefs.h"
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
--- lib/getopt.c.orig	2002-03-11 00:31:47.000000000 -0600
+++ lib/getopt.c	2022-08-09 20:28:49.000000000 -0500
@@ -55,7 +55,7 @@
 
 /* This needs to come after some library #include
    to get __GNU_LIBRARY__ defined.  */
-#ifdef	__GNU_LIBRARY__
+#if 1
 /* Don't include stdlib.h for non-GNU C libraries because some of them
    contain conflicting prototypes for getopt.  */
 #include <stdlib.h>
@@ -157,7 +157,7 @@
 /* Value of POSIXLY_CORRECT environment variable.  */
 static char *posixly_correct;
 
-#ifdef	__GNU_LIBRARY__
+#if 1
 /* We want to avoid inclusion of string.h with non-GNU libraries
    because there are many ways it can cause trouble.
    On some systems, it contains special magic macros that don't work
--- lib/screen.c.orig	2002-03-11 00:31:47.000000000 -0600
+++ lib/screen.c	2022-08-09 20:31:53.000000000 -0500
@@ -20,9 +20,7 @@
 
 #include "misc.h"
 
-#ifndef TIOCGWINSZ
 #include <sys/ioctl.h>
-#endif
 
 
 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--- lib/xmalloc.c.orig	2002-03-11 00:31:47.000000000 -0600
+++ lib/xmalloc.c	2022-08-09 20:24:41.000000000 -0500
@@ -27,6 +27,7 @@
 
 #if !defined (ALREADY_HAVE_XMALLOC)
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 
 extern void *malloc (), *realloc ();
