Cleanups and fixes related to automake upgrade

This removes a few legacy workarounds and fixes for older versions of
automake. This also removes adding specific DEBUG flags for tests since
subdir objects are handled differently now.
Remove unneeded imports
Make missing Python modules a waring

This avoids having to have all modules installed in the build
environment. A Python version is still required during build.
Add more python module checks to configure
Also support poll() returning EAGAIN