NEW YORK (AP) _ With a close eye on state polls and a flexible schedule, Michael Dukakis approached the final weekend of the 1988 presidential campaign today saying that after early problems getting his message out ''people are getting a much better sense of who Mike Dukakis is.''

''The test of a good president isn't who comes up with the best commercial,'' he said in a jab at the electronic attacks used effectively by Republican presidential nominee George Bush.

During a 30-minute interview on NBC-TV's ''Today,'' the Democratic presidential candidate repeated the theme that has dominated his closing campaign drive: that the election is a question of who will best stand up for middle class Americans.

''I think they see in Mike Dukakis and Lloyd Bentsen a very strong team that will stand up for them and I think that's the fundamental issue,'' he said.

Bush appeared on the same show on Thursday.

After a rally in Forest Hills, a middle class section of Queens, Dukakis was flying to Kentucky and then on to Chicago for a torchlight parade.

The Kentucky stop was added to his schedule by aides who were keeping a close watch for any movement in polls that might indicate a stop in a particular state would give Dukakis' campaign some additional momentum.

During the interview, Dukakis refused to speculate on whom he would name to Cabinet posts and specifically on what role Jesse Jackson might have in a Dukakis administration.

''I'm not going to talk about naming Cabinet members,'' he replied. When pressed on a possible role for Jackson, he replied, ''He's involved; the entire (black) community's involved.''

Dukakis conceded ''it took me a while to get a sense of how you take your case to the American people.''

But he said that ''in the last two or three weeks people are getting a much better sense of who Mike Dukakis is who wants to be president of the United States, and I think that's one of the reasons frankly why we're doing better and closing this gap.''

The candidate's voice sounded improved from the previous day when it grew increasingly weak as he raced from rally to rally.

''This voice of mine is pretty hoarse,'' Dukakis told a large crowd outside Ansonia, Conn., City Hall.

Throughout Thursday, campaign aides touted new polling information to support their contention the race was tightening.

''KRC has us up by three in Illinois,'' said aide Kirk O'Donnell.

''This is the right dynamics in the last days of the campaign,'' said Paul Brountas, the Dukakis campaign chairman.

But major national polls said the Democratic nominee was trailing by margins ranging from seven to 13 points.

Word from Sen. Frank Lautenberg that one of his statewide polls showed a dramatic drop in Republican George Bush's margin over Dukakis in New Jersey prompted an impromptu rally for precinct workers at Newark airport on Thursday.

Campaign sources, who spoke on condition of anonymity, said the poll done for the New Jersey senator who is running for re-election, said that Bush's lead in the state, which had been 16 points, was down to six.

However, a statewide survey released last weekend showed Bush ahead by 14 points.

Invoking the name of New Jersey native and singer Bruce Springsteen, Dukakis told his supporters, ''Like another great son of New Jersey, I was born to run and win.''

Campaign aides were studying the latest data from Ohio and considering adding a stop in that critical industrial state.

Dukakis drew large crowds at rallies in Bridgeport, Ansonia and Waterbury, Conn., Thursday night. Connecticut is another state where the Dukakis-Bush race is considered close.

''Lloyd Bentsen and I are going to surprise the pollsters and the pundits on Tuesday,'' he told cheering crowds.

Dukakis stuck to the mix of populism and attack that has drawn enthusiastic crowd reaction at rallies from California to Connecticut.

''They want a tax break for the wealthy,'' he said, ''we want college opportunity for every young American.''

''I know Boston Harbor is polluted and the Republican capaign is polluted,'' said Dukakis, who has been attacked in Bush commercials for failing to do more to clean up his local harbor.

''There's only one difference,'' he went on, ''I'm cleaning up Boston Harbor.''

Dukakis drew one of the larger crowds of his campaign - about 15,000 people - in front of City Hall in Philadelphia.

''The difference between Mr. Bush and me is that his administration has cut deals with foreign drug-runners, I'm going to cut aid to foreign drug- runners,'' he said.

At every stop crowds sang ''Happy Birthday,'' and presented the candidate with a cake commemorating his 55th birthday.

Dukakis' wife, Kitty, who had been hospitalized with a respiratory infection planned to rejoin her husband today in time for a torchlight parade in Chicago.

Adding a touch of glamour to the Dukakis entourage were actress Debra Winger and actor Mark Hamill.

''I have an 18-month-old son,'' Ms. Winger told the crowd at Ansonia. ''George Bush is his nightmare.''