President Donald Trump said he does not see a role for the U.S. in Libya apart from defeating Islamic State militants.