allow Bazel to build without glog and gflags (#69995)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69995
ghstack-source-id: 146027060
Test Plan: Imported from OSS
Reviewed By: malfet
Differential Revision: D33141010
fbshipit-source-id: d951e5616459e8aa163ae0741e245f53185580e8