fixed protobuf related build errors

when building the first time I faced build errors like this:
http://snipt.org/Ahgif1 and test failures.