One way to make a powerful Poland would be to have the Jagiellons not die out in 1526, and (VERY IMPORTANT HERE) get a secure hold over the nobility. If the King can assert his power over the nobility, than he can turn his attention to dealing with foreigners. Many of whom, it might be added, are either in the midst of periods of extreme weakness/fragmentation (Germany) or will enter such periods on the not-too-distant future (Russia). A good, stable monarch will have plenty of oppertunities to expand his borders and create the strongest power east of the Rhine. All this depends on creating a strong central goverment in the 1500s.
Another more interesting (IMO) way would be to avoid the period of fragmentation 1138-1306 by having Boleslaw III not divide his kingdom in his will. Then, you have a strong Poland even earlier, and with the potential to expand greatly in the aftermath of the Mongol invasions.