Yes, with a DM judgement on longbows acting as quarterstaves
In the scenario you've provided, you have a character wielding a Long Bow as an improvised weapon for a melee attack.
In general, improvised weapons are not simple melee weapons but their own thing. Except in the case where it resembles an existing weapon:
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.
A longbow as a melee weapon is similar to a quarterstaff
I don't think it's unreasonable for a DM to equate the longbow with the quarterstaff. They are similar in form and if they are ruled as such, then the improvised weapon would be
treated as such [a quarterstaff]
A quarterstaff is one of the options for monk weapons, which only require:
any simple melee weapons that don’t have the two-handed or heavy property.
The quarterstaff has neither of those properties and is a simple weapon so it would be eligible for martial arts die.
Therefore the longbow, acting as a quarterstaff in an improvised fashion, would use martial arts die if the DM thinks the relationship between the two weapons is close enough - and I do think it's reasonable to do that.
Is it strong enough to withstand an attack?
This will also be up to the DM. In form it's similar, but in strength it may not be. A DM could rule that it is similar enough to function, but there may be a risk of damage to it as well if you try and smack someone with it.
However, just like in the example given that a table leg is akin to a club, a table leg is much more likely to break on impact than a club weapon would. If that is allowed, then I don't see a huge issue in the longbow as stave.
I hate bringing real life into fantasy, but Gerald of Wales discussed the Welsh longbows as follows (my emphasis):
They are made neither of horn, ash nor yew, but of elm; ugly unfinished-looking weapons, but astonishingly stiff, large and strong, and equally capable of use for long or short shooting.
But is this a good idea?
The biggest concern here is that you now allow a character to be wielding a ranged weapon that can also be used as a melee weapon and they can choose which they want to use at any given time. This on its face seems a little overpowered but it can still be up to the DM to allow or just allow as needed.