Depends how you define the term. If you're imposing a very strict definiton, there's only ever been one; Ramsay MacDonald. Arguments can be made for Wilson, Callaghan and Major but - in all cases - there are strong arguments to file them under 'lower middle class' instead. Major's father was a former music-hall performer and failed garden-gnome manufacturer
Not failed. The company was still in existence (and in Major's elder brother's ownership) during Major's tenure as PM.
Major (and Callaghan and Wilson; not to mention Brown and Thatcher and especially Lloyd George) weren't working class, but they weren't born into a special privileged caste. Unlike Clegg and Cameron and Blair and, well, all the other 20th century prime ministers (unless I'm forgetting someone) and certainly all prime ministers
before Lloyd George (unless you go really way, way back to the ministers of the late middle ages - with the term prime minister not yet in existence. They actually include some people of rather common origins. Thomas Cromwell, for one.)