US President Donald Trump has spoken with Libyan General Khalifa Haftar and praised him for his role in fighting terrorism.