Automatically detect compiler flags for C++11 mode

This is achieved using the AX_CXX_COMPILE_STDCXX_11 macro by Benjamin
Kosnik and Zack Weinberg.

Signed-off-by: Morten Hustveit <mortehu@google.com>
Added a loop to wait for dead child processes

Without these, we tend to accumulate a lot of zombie children in long
sessions.

Signed-off-by: Morten Hustveit <mortehu@google.com>