Use printenv
available in most of the linux distros. Simply run
printenv ${VAR_PREFIX}_VARNAME
NOTE: One disclaimer is that the actual variable needs to be exported.
So for this example:
export VAR_PREFIX=some_prefix
export some_prefix_VARNAME=some_value
printenv ${VAR_PREFIX}_VARNAME
result is:
some_value