Fix builds on Debian wheezy.

Fixes #5596