Some changes to make bonnie build with newer g++ and cross-compile
These commits contain some necessary changes to make bonnie builds with newer g++ versions and configure works for cross-compiling and some commits are clean-ups to remove warnings and update configure.