I think one thing that is being overlooked here is that "Heavy" weapons do not earn their property by their weight. Bows are lighter than most martial melee weapons, coming in at 2lb., and a longbow and shortbow share the same weight yet only the longbow is considered "heavy." Why? Well, if you read the key part of the property definition, "A heavy weapon's size and bulk make it too large for a Small creature to use effectively." That tells you the property is all about size and bulk, and that is what determines if you are able to use the weapon "effectively." It no longer being "effectively" used just means you are imposed disadvantage.
Now that the definition of heavy has been cleared up as simply being size and bulk.. just because a weapon is being used for a different purpose, the size and bulk has remained the same, no? So.. that property should not be lost. Also like others have pointed out, the section on improvised weapons states "Often, an improvised weapon is similar to an actual weapon and can be treated as such. For example, a table leg is akin to a club. At the DM's option, a character proficient with a weapon can use a similar object as if it were that weapon and use his or her proficiency bonus." I would say that a longbow is akin to a quarterstaff due to the way you would use it for a melee attack, so you would get the proficiency bonus if you are proficient with simple melee weapons. However that section does also specify "If a character uses a ranged weapon to make a melee attack ... it also deals 1d4 damage" and since a longbow is classified as a ranged weapon before being utilized as a melee weapon, that would apply. So by strict adherence to these guidelines my take is when making a melee attack with a longbow you are using it as a 1d4 quarterstaff (and you could have the simple weapon proficiency bonus), but it should still be classed as a heavy weapon due to its size and bulk remaining unchanged.
Nowhere in the improvised weapons section does it say a weapon's properties magically disappear just because it is being used for a different purpose or being reclassified, all that section is doing is redefining objects as falling under a different class of weapon; improvised weapons; just like simple melee weapons, martial melee weapons, etc.. Which is why a key part of the Tavern Brawler feat is to be proficient with them.. Or, what that section is doing is allowing objects to be redefined as an existing type of weapon at the DM's choice.
So my answer is YES, it should qualify for the perk of Great Weapon Master feat to gain -5 attack and +10 damage. As silly as it may be, and not in the players interest to do, due to sub-optimal damage and feat use.
But I will also argue that NO, using a longbow to make a improvised melee attack does NOT also qualify for the Sharpshooter feat's -5 attack +10 at the same time, allowing -10 attack +20 damage... Because, this should really go without saying, you are no longer using the longbow as a ranged weapon, you are using it as a melee weapon. Should the Sharpshooter feat's bonuses instead be qualified for use with an improvised thrown weapon, or any other weapon attack made from range? Yes, I believe it should.
As far as the gnome and greataxe throwing example that seems to keep being brought up.. Gnomes are 40lb, do you really think they can't lift something 7lb and toss it in an improvised fashion, even one handed? ...Can they not do a single push up, 20lb per arm? For reference, the rules say a gnome is capable of doing a grapple with only needing one free hand on another creature up to one size larger, so medium creatures... which can be up to 500lb, not to mention all the gear they could be carrying! Oh! And then they can carry or drag them up to half movement speed.. does that not have a greater disruption of suspension of disbelief?! I mean, if a gnome can pull off that feat of strength, I certainly think it can toss a measly 7lb object up to 60ft. I would say however, that a gnome should still be imposed disadvantage on throwing any weapon with the heavy property at any range, because by the property definition of heavy I went over earlier, it is still of a larger size and bulk. Keeping with that logic, I would say anything too large or bulky should impose disadvantage if used as any classification of weapon by a small creature, improvised or otherwise.