President Donald Trump has said if Elon Musk's Tesla built a factory in India to avoid that country's tariffs, it would be unfair to the US.