This depends on DM ruling.
The rules don't explicitly cover this case, so there are two, equally-valid ways to rule this.
The first is that improvised weapons don't count as weapons. This ruling is supported mainly by a few parts of the Improvised Weapons description (page 147, PHB). It says:
Sometimes characters don't have their weapons and
have to attack with whatever is dose at hand... In many cases, an improvised weapon is similar to an actual weapon...
These line heavily imply that, while improvised weapons often act like weapons, they actually aren't. Since magic weapon specifies that it can only target weapons, by this ruling improvised weapons can't be made magic.
This interpretation is supported by Jeremy Crawford, who tweets:
Weapon Bond works with a bona fide weapon ("Behold, my sword!"), not an improvised weapon ("Look, a stool!").
The second interpretation is that, since the phrase "improvised weapons" contains the word "weapon", then improvised weapons must be weapons. With this interpretation, anything that can be done to a weapon can also be done with an improvised weapon.
Both of these interpretations are valid, and based on valid rules reasoning, so this is going to be dependent on your DM.