Critical mass in a generalized Smoluchowski-Poisson system