autoconf: added checks for libio.h, elf.h, curses.h,ncurses.h and
fixed includers.

diff --git a/misc/port.c b/misc/port.c
index aba2d0a..5e03c6e 100644
--- a/misc/port.c
+++ b/misc/port.c
@@ -12,7 +12,9 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <termios.h>
-#include <libio.h>
+#ifdef HAVE_LIBIO_H
+# include <libio.h>
+#endif
 
 #ifndef HAVE_USLEEP
 #ifdef __EMX__