Fix possible error in prgen.py
Fix possible error in prgen.py

- configs['links'] can be None, so make it not be used as target of
  for-in loop directly.

- Use configurable template dir name.

kghoon/epgen