autoconf: split into subdirectories; redirect calls in debug builds