Fix CFLAGS order.
Fix detected flags from ACX_PTHREAD being reset.
Include path should be CPPFLAGS, not CFLAGS.
Default bundlesequence to { main }

This removes the need for a body common control to satisfy
a runnable policy. For example a runnable policy may be

bundle agent main {
 reports:
   "hello world";
}

Redmine #4993
Merge pull request #1765 from jimis/minor

Fix detected flags from ACX_PTHREAD being reset.