Use a custom macro to get a struct member sizeof().

Older compilers (GCC 4.4 and below at least) do not properly implement
sizeofing struct members (which was introduced in C++11).
Fix the libraries in CMakeLists.txt
Document the compiling process.