Fix compilation issues in Ubuntu.

For a detailed description of the problem that was solved, see here:
https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition