Check that we have lua and protobuf before relying on types from them

A couple of fixes I needed to build on one of the devhosts for a configure line without protobuf or Lua.

cc @hollinger @zerebubuth