Former ATP Open Sud de France champion Gael Monfils was made to work hard for a three-set victory against Lukasz Kubot to reach the second round.