Using the if statement with the Serial monitor

 if (myname="Max")

= for assignment, == for comparison. The if is a comparison.