There are a number of ways to do this depending on how critical overall re-compilation time is for you, and how many different parameter values you need to deal with.
If you want to override the parameter value on the command line and you are using Questa, you can use the -G vsim option. Otherwise you might have to use +define to change the override value from the command line and recompile.