Fix configure/build for protobuf and yajl

There are 2 commits, one each for protobuf and yajl.

Commit message has a more detailed explanation on what is fixed/updated for each of the above.