Added packaging option. Fixing some linking problems with gflags