Switch to using autotools instead of a standalone makefile
Ensure no integer overflow can occur in attach.c

- Added reallocarray(3) from OpenBSD
- autotools improvements
- Added config.h