This question reveals the history of the peppermint sweet's name, but does not elabourate on how the word was first formed.
At first glance, it would seem to be a portmanteau or the like just from the word "bug"; is this at all pertinent?
Etymonline is left clueless, quoting the OED who appear that have also given up:
1751, student slang, "trick, jest, hoax, imposition, deception," of unknown origin. Also appearing as a verb at the same time, "deceive by false pretext" (trans.). A vogue word of the early 1750s; its origin was a subject of much whimsical speculation even then. "[A]s with other and more recent words of similar introduction, the facts as to its origin appear to have been lost, even before the word became common enough to excite attention" [OED].
I'm sure the users of EL&U can dig deeper and find out where exactly the word humbug comes from.
Can you build on "unknown origin"?