Why was Trump claiming to be "somewhat libertarian"? Because he wants libertarians to vote for him.
Rejecting Trump's entreaty, Bonnie Kristian has written an interesting response in an article entitled "The Obliteration of the Republican-Libertarian Alliance," which appears today in This Week. She writes:
As a libertarian, no. No to all of this. No, in fact, to the self-serving claims of "libertarianism" by Republicans who just want to use weed or get our votes. No to the assumption that the Republican Party is automatically the lesser of two evils from the libertarian perspective. Whatever case there used to be for that alliance rested on the GOP at least pretending to share libertarians' fiscal conservatism. With Trump, that pretense is gone. We do not "have to" vote for Republican candidates generally, and we certainly don't have to vote for this Republican.
Kristian makes reference to the concept of "fusionism," which holds that conservatives and libertarians are really a unified philosophy owing to such mutually common positions as "a free market, fiscal discipline, low taxes, and a minimal regulatory bureaucracy."
Over the years, some libertarians have bought into this concept, arguing that conservatives were closer to the libertarian perspective than progressives and, therefore, libertarians and conservatives should work together to defeat progressives.
Rejecting that notion, Kristian points out,
The Republican Party of 1980 to 2015 often let fall its limited government ideas outside the economic realm; the drug war, mass surveillance, and the Pentagon playing world police are all big government, too. But even if Reagan was right then, libertarianism is emphatically not the heart and soul of the Republican Party today. The tear is complete. If the alliance ever made sense, it does not anymore…. Libertarians are not properly part of the GOP coalition, if indeed we ever were. There is no libertarianism in the soul of the Trumpian Republican Party, and Republican partisans today are not libertarians.