He didn't build it under the Romulans' noses. Remember, he had Romulan backers. As established at the start of the film, the Praetor and the Senate wished to continue the detente with the Federation that had existed since the Dominion War, but Suran's faction in the Romulan military wished to resume their policies of conquest and aggression. Shinzon won their support because of his impressive combat record in the DW and because he promised the militants that he would restore the Romulan Empire to an aggressive footing. So they provided him with the resources and backing to prepare for the coup, and presumably that included the thalaron technology. Remember, it was a Romulan traitor, Senator Tal'Aura, who deployed the handheld thalaron weapon that assassinated Praetor Hiren and the rest of the Senate.
Historically, the best way for an outsider to overthrow a regime has often been to ally with those within the society who already want to overthrow it -- ideally, make them do the work and then seize the fruits of their victory for yourself, like Cortez did when he "helped" the Mexica overthrow the Aztecs and then took over as their new master. That's what Shinzon did here: offered the Romulan militants support for their coup, got them to install him as the new Praetor in the belief that he'd serve their ends, then turned on them and pursued his own agenda.