Unify flags and environmental variable when building LibTorch/PyTorch (#15868)
Summary:
Fixes #15858.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15868
Differential Revision: D13622354
Pulled By: soumith
fbshipit-source-id: bb8c49520ebf926c6194d42db75accba867018c7