Criminal Law Questions? Ask a Criminal Lawyer.
if they say they smelled marijuana then they would have reasonable suspicion to impound the car to do a search - police do not need to obtain a warrant if he has observed illegal items - scent of marijuana falls into this category - and believes that the items will disappear unless the officer takes prompt action.
on the other hand, police are required, to follow fair and standardized procedures when they search your car, and may not stop you and impound your car simply to perform a search - so you might have something if you were not breaking any laws when they pulled up behind you. though "loitering" could be sited as probable cause.