I had to reinstall this library since the version I had was an old one, even though linux said it had the latest version.
I cloned the repository and followed the instructions
https://github.com/gflags/gflags/blob/master/INSTALL.md
On thing that I needed as an option was to add the
CMAKE_CXX_FLAGS=-fPIC
Because I needed the library to work with torch, so I just went to the advance options of ccmake and looked for that variable and changed it.
gflags didn't give me a problem after that. I am still trying to install the other dependencies for fblualib but we will see how that goes.
Good luck