Fixes to make Firedrake build on cx1

At the same time this doesn't break the build on Ubuntu/Debian.