Ecauchy:

/home/thomas/anaconda3


That is your CMAKE path.
export CMAKE_PREFIX_PATH="/home/thomas/anaconda3"
LD Library path is usually more complicated, with 3-5 different paths in it.  “/usr/lib:/home/thomas/anaconda3/lib:etc:etc”
On a side note, since you are new to PyTorch it might be much quicker to just do conda install pytorch -c soumith and try it out