You installed system gcc compiler. Your original question was how to install gcc-4.8xx. If you are using pkgsrc the easiest thing is
cd /usr/pkgsrc/lang/gcc48
make install clean clean-depens
Note that NetBSD has multiple versions of gcc compiler the 2.9.5 probably the most useful and the last truly portable gcc version. The first place to check
for pkgsrc package is
pkgsrc.se
you also want to read documentation on pkgsrc
http://www.netbsd.org/docs/guide/en/index.html
NetBSD also has new binary packaging system pkgin which is very similar to Yum and apt-get but I am not a regular NetBSD user so you would want to check documentation how to use pkgng
comp
package, you should have gcc. You say that "gcc is still not able to compile simple programs." What does that mean? What errors do you encounter?