Improved portability in ./configure to add detection for various smaller
items, such as headers necessary for openpty(3), et cetera; improve
overall script structure
Changes:
* Make ./configure generate src/config.h, which will contain the
appropriate #include for endian.h, or #defines to provide
alternatives
* Make sure to include config.h in src/frame.c to allow compiling
on macOS