Use miopen_LIBRARIES and rccl_LIBRARIES directly, when they are valid target (#80446)
As of [this RCCL PR](https://github.com/ROCmSoftwarePlatform/rccl/pull/570), `${rccl_LIBRARIES}` refers to the actual RCCL library target, not just a symbolic "rccl" string. So starting from the next release, no special treatment of it would be required in PyTorch anymore. This patch checks whether `${RCCL_LIBRARIES}` and `${MIOpen_LIBRARIES}` are already valid, and if they are - is not trying to find them manually.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80446
Approved by: https://github.com/pruthvistony, https://github.com/malfet