Issue 9296: LITTLE_ENDIAN and BIG_ENDIAN are always defined on Linux

My solution is to replace `LITTLE_ENDIAN` and `BIG_ENDIAN` with `__LITTLE_ENDIAN__`
and `__BIG_ENDIAN__`. These are flags which are defined for clang and old gcc
versions but not in a glibc include file. The makefiles are changed to contain the right definition.