Patch from RedHat fixing FTBFS on s390 arch

https://bugzilla.redhat.com/show_bug.cgi?id=1118248

Fixes an error with compile and link flags that prevents building on the s390 architecture. Please also apply to the stable 2.10 branch.