luminance-hdr adds hardcodes -msse -msse2 in CFLAGS. Afaict this seems to be rather broken:
1 It is not necessary for working luminance-hdr. I have just testbuilt 2.4.0 on i386 without these flags and got a working program. (It might be slower, but it still works.)
2 These flags are set by default by gcc on today's most popular architecture (amd64). There is no point in adding them.
3 It stops luminance-hdr from building on other architectures. These flags are only available on i386/amd64.
As a proof of concept I made a successful build on s390x afer applying the attached patch.