ok I got it to work I made the following changes
removed ->
gretl_set_path_by_name("gnuplot", "/usr/bin/gnuplot");
and replaced with ->
char gnu_dir[]="/usr/local/bin/gnuplot";
strcpy(config_path.gnuplot ,gnu_dir);
err = gretl_set_paths (&config_path);
riley