Remove more usages of variable array subscripts. Fixes issues #977, #975, #979 and #981
-lrt should be in portability_ldflags, not portability_cflags